{extends file="base.html"}

{block name=global}
<div class="assoc_load">
    <div class="assoc_load_box">
        {if $error}
        <div class="error">{$error}关联条件配置错误</div>
        {/if}
        <div class="search clearfix">
            <input type="text" placeholder="输入搜索关键词" class="layui-input" value="{$info.keyword}"/><a href="{url('assoc_select', ['assoc' => $info.assoc, 'keyword' => 'KEY_WORD_HOLDER'])}" rel="assoc_select_load_search"  class="javascript assoc_select_search layui-btn">搜索</a>
        </div>
        {if $list}
        <div>
            <table class="layui-table">
                <colgroup>
                    <col width="20%">
                </colgroup>
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>{$info.name}</th>
                        <th class="action">操作</th>
                    </tr> 
                </thead>
                <tbody>
                    {foreach $list as $item}
                    <tr>
                        <td>{$item.id}</td>
                        <td>{$item[$info.field]}</td>
                        <td class="action"><a href="javascript:void(0);" data-value="{$item[$info.field]}" rel="assoc_selected" data-id="{$item.id}"  class="layui-btn javascript  layui-btn-sm">选择</a></td>
                    </tr>
                    {/foreach}
                </tbody>
            </table>
        </div>
        <div class="pagination">
        {include file="./nice_pageination.html" noinfo=true}
        </div>
        {else}
        <div class="no_list">没有搜索到关联数据</div>
        {/if}
    </div>
</div>
{/block}